<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
  <head>
    <title> boss </title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
    <?php htmlhead(); ?>
  </head>
  
  <body>
    
    <div class="navTool menuborder">
      <div class="panel">
      <form method="post" action="?act=boss_add" name="myform" id="myform" class="myform">
        <dl>
          <dt>对应副本</dt>
          <dd>
            <select name="instance_id">
              <?php
              foreach($instances as $_=>$v) {
                echo('<option value="'.$v['instance_id'].'">'.$v['instance_name'].'</option>');
              }
              ?>
            </select>
          </dd>
        </dl>
        <dl>
          <dt>BOSS编号</dt>
          <dd><input type="text" name="boss_gameid" value="" /></dd>
        </dl>
        <dl>
          <dt>BOSS名称</dt>
          <dd><input type="text" name="boss_name" value="" /></dd>
        </dl>
        <dl>
          <dt>BOSS图片</dt>
          <dd><input type="text" name="boss_pic" value="" /></dd>
        </dl>
        <dl>
          <dt>首杀时间</dt>
          <dd><input type="text" name="boss_flag" value="" /></dd>
        </dl>
        <dl>
          <dt>击杀次数</dt>
          <dd><input type="text" name="boss_num" value="0" /></dd>
        </dl>
        <dl>
          <dt></dt>
          <dd><input type="submit" value="新增" class="btn" /></dd>
        </dl>
      </form>
      </div>
    </div>
    
    <table class="table">
      <thead>
        <tr>
          <th style="width:30px;">ID</th>
          <th style="width:100px;">图示</th>
          <th style="width:auto;">名称</th>
          <th style="width:150px;">所属副本</th>
          <th style="width:120px;">是否击杀</th>
          <th style="width:60px;">击杀次数</th>
          <th style="width:128px;">操作</th>
        </tr>        
      </thead>
      <tbody>    
      <?php
        foreach($data as $_=>$v) {
          echo('<tr id="'.$v['boss_id'].'">');
          echo('  <td>'.$v['boss_gameid'].'</td>');
          echo('  <td>');
            if($v['boss_pic']) echo('<img src="'.$v['boss_pic'].'" />');
          echo('  </td>');
          echo('  <td>'.$v['boss_name'].'</td>');
          echo('  <td>'.$v['instance_name'].'</td>');
          echo('  <td>');
            if($v['boss_flag']) echo('已击杀:'.date('Y-m-d',$v['boss_flag']));
          echo('  </td>');
          echo('  <td>'.$v['boss_num'].'</td>');
          echo('  <td>');
          echo('    <span class="acticon actedit"><a href="?view=boss_edit&id='.$v['boss_id'].'">修改</a></span>');
          echo('    <span class="acticon actrecycle"><a onclick="return confirm(\'确定删除?\');" href="?act=boss_delete&id='.$v['boss_id'].'">删除</a></span>');
          echo('  </td>');
          echo('</tr>');
        }
      ?>
      </tbody>
    </table>
    
    <script>
      $(document).ready(function(){
        $(".table tr").hover(function() {
          if ($(this).hasClass('trhover'))
            $(this).removeClass('trhover');
          else
            $(this).addClass('trhover');          
        });
      });
    </script>
    
    <script>
    <?php echo getTips(); ?>
    </script>
    
</body>
</html>